/****************************************************
 * Description: Controller for api_terminal
 * Copyright:   Copyright (c) 2020
 * Company:     kuke
 * @author      zhanghejie
 * @version     1.0
 * @see
	HISTORY
	*  2020-05-01 zhanghejie Create File
**************************************************/
package com.xjj.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Api(tags = "测试接口")
@Controller
@RequestMapping("/test")
public class TestController{

	/**
	 *
	 * @param name
	 * @return
	 */
	@ApiOperation(value = "HelloWorld",notes = "HelloWorld")
	@ApiImplicitParams({@ApiImplicitParam(name = "name",value = "名称",required = true)})
	@ResponseBody
	@RequestMapping("/hello")
	public ResponseDTO hello(@RequestParam(name = "name") String name) {
		Person p = new Person();
		p.setName(name);
		return ResponseDTO.success(p);
	}

	private class Person
	{
		private String name;
		private int age;

		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public int getAge() {
			return age;
		}
		public void setAge(int age) {
			this.age = age;
		}
	}
}

